﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="itasset.aspx.vb" Inherits="str_itasset" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
      <ContentTemplate>
          <asp:ScriptManager ID="ScriptManager1" runat="server">
           </asp:ScriptManager>
          <h2>IT Asset Entry</h2>
          <asp:TextBox ID="lblLogs" runat="server" Visible="False">Failed</asp:TextBox>
          <table style="width: 100%;">
              <tr>
                  <td>Company</td>
                  <td>
                      <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" CssClass="textbox">
                          <asp:ListItem>Select Company</asp:ListItem>
                          <asp:ListItem Value="KR">EPEI</asp:ListItem>
                          <asp:ListItem Value="SBC">CMI</asp:ListItem>
                          <asp:ListItem Value="KG">GBC</asp:ListItem>
                          <asp:ListItem Value="DGB">Dream Gastro</asp:ListItem>
                          <asp:ListItem Value="HO">HEAD OFFICE</asp:ListItem>
                      </asp:DropDownList>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator16" runat="server" ControlToValidate="DropDownList1"></asp:RequiredFieldValidator>
                  </td>
                  <td>Store</td>
                  <td>
                      <asp:DropDownList ID="DropDownList2" runat="server" CssClass="textbox" DataSourceID="SqlDataSource1" DataTextField="storename" DataValueField="storename">
                          <asp:ListItem>Select Store</asp:ListItem>
                      </asp:DropDownList>
                      <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" SelectCommand="SELECT [storename] FROM [stores] WHERE ([company] = @company)">
                          <SelectParameters>
                              <asp:ControlParameter ControlID="DropDownList1" Name="company" PropertyName="SelectedValue" Type="String" />
                          </SelectParameters>
                      </asp:SqlDataSource>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator18" runat="server" ControlToValidate="DropDownList2"></asp:RequiredFieldValidator>
                  </td>
              </tr>
              <tr>
                  <td>Asset Class</td>
                  <td>
                      <asp:DropDownList ID="lstAssetClass" runat="server" CssClass="textbox" DataSourceID="assetSource" DataTextField="assetclass" DataValueField="assetclass" >
                          <asp:ListItem>Select Asset Class</asp:ListItem>
                      </asp:DropDownList>
                      <asp:SqlDataSource ID="assetSource" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" SelectCommand="SELECT * FROM [ita_assetclass]"></asp:SqlDataSource>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" ControlToValidate="lstAssetClass"></asp:RequiredFieldValidator>
                  </td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
              </tr>
              <tr>
                  <td>Assignee 1</td>
                  <td>
                      <asp:TextBox ID="txtassignedTo" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtassignedTo" Display="None" ErrorMessage="* Assignee 1  is Required"></asp:RequiredFieldValidator>
                  </td>
                  <td>Assignee 4</td>
                  <td>
                      <asp:TextBox ID="Assignee4" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td>Assignee 2</td>
                  <td>
                      <asp:TextBox ID="txtCurrentAssignee" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
                  <td>Assignee 5</td>
                  <td>
                      <asp:TextBox ID="Assignee5" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td>Assignee 3</td>
                  <td>
                      <asp:TextBox ID="Assignee3" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
                  <td>Asset Ending ID</td>
                  <td>
                      <asp:DropDownList ID="txtAssetEndingID" runat="server" CssClass="textbox" DataSourceID="SqlAssetCounter" DataTextField="ita_assetnumber" DataValueField="ita_assetnumber" Enabled="False" Width="122px">
                      </asp:DropDownList>
                  </td>
              </tr>
              <tr>
                  <td>Year Acquired</td>
                  <td>
                      <asp:TextBox ID="txtYearAcquired" runat="server" CssClass="textbox" TextMode="Number">2014</asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtYearAcquired" Display="None" ErrorMessage="* Year  is Required"></asp:RequiredFieldValidator>
                  </td>
                  <td>Date Purchase</td>
                  <td>
                      <asp:TextBox ID="txtDatePurchased" runat="server" CssClass="textbox" TextMode="Date"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ControlToValidate="txtDatePurchased" Display="None" ErrorMessage="* Date Purchase  is Required"></asp:RequiredFieldValidator>
                  </td>
              </tr>
              <tr>
                  <td>Supplier</td>
                  <td>
                      <asp:TextBox ID="txtSupplier" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtSupplier" Display="None" ErrorMessage="* Supplier  is Required"></asp:RequiredFieldValidator>
                  </td>
                  <td>Date Delivered</td>
                  <td>
                      <asp:TextBox ID="txtDateDelivered" runat="server" CssClass="textbox" TextMode="Date"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator15" runat="server" ControlToValidate="txtDateDelivered" Display="None" ErrorMessage="* Date Delivered  is Required"></asp:RequiredFieldValidator>
                  </td>
              </tr>
              <tr>
                  <td>Device Type</td>
                  <td>
                      <asp:TextBox ID="txtdevicetype" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtdevicetype" Display="None" ErrorMessage="* Device Type  is Required"></asp:RequiredFieldValidator>
                  </td>
                  <td>Serial No.</td>
                  <td>
                      <asp:TextBox ID="txtserial" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtserial" Display="None" ErrorMessage="* Serial Number  is Required"></asp:RequiredFieldValidator>
                  </td>
              </tr>
              <tr>
                  <td>Brand</td>
                  <td>
                      <asp:TextBox ID="txtbrand" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtbrand" Display="None" ErrorMessage="* Brand  is Required"></asp:RequiredFieldValidator>
                  </td>
                  <td>Model</td>
                  <td>
                      <asp:TextBox ID="txtmodel" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td style="vertical-align: top">Specs</td>
                  <td>
                      <asp:TextBox ID="txtspecss" runat="server" CssClass="multitextbox" TextMode="MultiLine"></asp:TextBox>
                  </td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
              </tr>
              <tr>
                  <td>P.O.</td>
                  <td>
                      <asp:TextBox ID="txtpo" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtpo" Display="None" ErrorMessage="* P.O.  is Required"></asp:RequiredFieldValidator>
                  </td>
                  <td>Warranty</td>
                  <td>
                      <asp:TextBox ID="txtwarranty" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="txtwarranty" Display="None" ErrorMessage="* Warranty  is Required"></asp:RequiredFieldValidator>
                  </td>
              </tr>
              <tr>
                  <td>Cost</td>
                  <td>
                      <asp:TextBox ID="txtcost" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="txtcost" Display="None" ErrorMessage="* Cost  is Required"></asp:RequiredFieldValidator>
                  </td>
                  <td>Invoice No.</td>
                  <td>
                      <asp:TextBox ID="txtinvoice" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td>Received By</td>
                  <td>
                      <asp:TextBox ID="txtrecieved" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ControlToValidate="txtrecieved" Display="None" ErrorMessage="* Received By  is Required"></asp:RequiredFieldValidator>
                  </td>
                  <td>Date Received</td>
                  <td>
                      <asp:TextBox ID="txtdaterecieved" runat="server" CssClass="textbox" TextMode="Date"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td>Deployed By</td>
                  <td>
                      <asp:TextBox ID="txtdeployedby" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
                  <td>Date of Deployment</td>
                  <td>
                      <asp:TextBox ID="txtdatedeployement" runat="server" CssClass="textbox" TextMode="Date"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td>Status</td>
                  <td>
                      <asp:TextBox ID="txtstatus" runat="server" CssClass="textbox"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ControlToValidate="txtstatus" Display="None" ErrorMessage="* Status  is Required"></asp:RequiredFieldValidator>
                  </td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
              </tr>
              <tr>
                  <td>LAN IP</td>
                  <td>
                      <asp:TextBox ID="txtlanip" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
                  <td>Gateway IP</td>
                  <td>
                      <asp:TextBox ID="txtgatewayip" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td>OS/Software</td>
                  <td>
                      <asp:TextBox ID="txtos" runat="server" CssClass="textbox"></asp:TextBox>
                  </td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
              </tr>
              <tr>
                  <td style="vertical-align: top">Other Details</td>
                  <td>
                      <asp:TextBox ID="txtother1" runat="server" CssClass="multitextbox" TextMode="MultiLine"></asp:TextBox>
                  </td>
                  <td style="vertical-align: top">Other Details</td>
                  <td>
                      <asp:TextBox ID="txtother2" runat="server" CssClass="multitextbox" TextMode="MultiLine"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td style="vertical-align: top">Actual Image</td>
                  <td>
                      <asp:FileUpload ID="FileUpload1" runat="server" />
                  </td>
                  <td style="vertical-align: top">&nbsp;</td>
                  <td>&nbsp;</td>
              </tr>
              <tr>
                  <td>&nbsp;</td>
                  <td style="vertical-align: middle">
                      <asp:Button ID="Button1" runat="server" CssClass="button" Text="Save" Width="197px" TabIndex="100" />
                  </td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
              </tr>
          </table>
          <br />
          <br />
      </ContentTemplate>
    </asp:UpdatePanel>
    <p>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" DeleteCommand="DELETE FROM [ita_items] WHERE [ita_key] = @ita_key" InsertCommand="INSERT INTO ita_items(company, assetclass, store, assignedto, currentassignee, yearpurchased, datepurchased, supplier, datedelivered, assetno, devicetype, serialno, brand, model, specs, po, warranty, cost, invoiceno, recievedby, daterecieved, deployedby, dateofdeployment, status, lanip, gatewayip, os_software, other1, other2, date_added, UploadedBy, Assignee3, Assignee4, Assignee5) VALUES (@company, @assetclass, @store, @assignedto, @currentassignee, @yearpurchased, @datepurchased, @supplier, @datedelivered, @assetno, @devicetype, @serialno, @brand, @model, @specs, @po, @warranty, @cost, @invoiceno, @recievedby, @daterecieved, @deployedby, @dateofdeployment, @status, @lanip, @gatewayip, @os_software, @other1, @other2, @date_added, @UploadedBy, @Assignee3, @Assignee4, @Assignee5)" SelectCommand="SELECT * FROM [ita_items]" UpdateCommand="UPDATE [ita_items] SET [company] = @company, [assetclass] = @assetclass, [store] = @store, [assignedto] = @assignedto, [currentassignee] = @currentassignee, [yearpurchased] = @yearpurchased, [datepurchased] = @datepurchased, [supplier] = @supplier, [datedelivered] = @datedelivered, [assetno] = @assetno, [devicetype] = @devicetype, [serialno] = @serialno, [brand] = @brand, [model] = @model, [specs] = @specs, [po] = @po, [warranty] = @warranty, [cost] = @cost, [invoiceno] = @invoiceno, [recievedby] = @recievedby, [daterecieved] = @daterecieved, [deployedby] = @deployedby, [dateofdeployment] = @dateofdeployment, [status] = @status, [lanip] = @lanip, [gatewayip] = @gatewayip, [os_software] = @os_software, [other1] = @other1, [other2] = @other2, [date_added] = @date_added WHERE [ita_key] = @ita_key">
            <DeleteParameters>
                <asp:Parameter Name="ita_key" Type="Int64" />
            </DeleteParameters>
            <InsertParameters>
                <asp:ControlParameter ControlID="DropDownList1" Name="company" PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="lstAssetClass" Name="assetclass" PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="DropDownList2" Name="store" PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="txtassignedTo" Name="assignedto" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtCurrentAssignee" Name="currentassignee" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtDatePurchased" Name="yearpurchased" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtDatePurchased" Name="datepurchased" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtSupplier" Name="supplier" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtDateDelivered" Name="datedelivered" PropertyName="Text" Type="String" />
                <asp:SessionParameter Name="assetno" SessionField="AssetID" Type="String" />
                <asp:ControlParameter ControlID="txtdevicetype" Name="devicetype" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtserial" Name="serialno" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtbrand" Name="brand" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtmodel" Name="model" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtspecss" Name="specs" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtpo" Name="po" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtwarranty" Name="warranty" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtcost" Name="cost" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtinvoice" Name="invoiceno" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtrecieved" Name="recievedby" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtdaterecieved" Name="daterecieved" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtdeployedby" Name="deployedby" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtdatedeployement" Name="dateofdeployment" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtstatus" Name="status" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtlanip" Name="lanip" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtgatewayip" Name="gatewayip" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtos" Name="os_software" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtother1" Name="other1" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtother2" Name="other2" PropertyName="Text" Type="String" />
                <asp:SessionParameter Name="date_added" SessionField="DateNow" Type="String" />
                <asp:SessionParameter Name="UploadedBy" SessionField="IdentityName" />
                <asp:ControlParameter ControlID="Assignee3" Name="Assignee3" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="Assignee4" Name="Assignee4" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="Assignee5" Name="Assignee5" PropertyName="Text" Type="String" />
                 </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="company" Type="String" />
                <asp:Parameter Name="assetclass" Type="String" />
                <asp:Parameter Name="store" Type="String" />
                <asp:Parameter Name="assignedto" Type="String" />
                <asp:Parameter Name="currentassignee" Type="String" />
                <asp:Parameter Name="yearpurchased" Type="String" />
                <asp:Parameter Name="datepurchased" Type="String" />
                <asp:Parameter Name="supplier" Type="String" />
                <asp:Parameter Name="datedelivered" Type="String" />
                <asp:Parameter Name="assetno" Type="String" />
                <asp:Parameter Name="devicetype" Type="String" />
                <asp:Parameter Name="serialno" Type="String" />
                <asp:Parameter Name="brand" Type="String" />
                <asp:Parameter Name="model" Type="String" />
                <asp:Parameter Name="specs" Type="String" />
                <asp:Parameter Name="po" Type="String" />
                <asp:Parameter Name="warranty" Type="String" />
                <asp:Parameter Name="cost" Type="String" />
                <asp:Parameter Name="invoiceno" Type="String" />
                <asp:Parameter Name="recievedby" Type="String" />
                <asp:Parameter Name="daterecieved" Type="String" />
                <asp:Parameter Name="deployedby" Type="String" />
                <asp:Parameter Name="dateofdeployment" Type="String" />
                <asp:Parameter Name="status" Type="String" />
                <asp:Parameter Name="lanip" Type="String" />
                <asp:Parameter Name="gatewayip" Type="String" />
                <asp:Parameter Name="os_software" Type="String" />
                <asp:Parameter Name="other1" Type="String" />
                <asp:Parameter Name="other2" Type="String" />
                <asp:Parameter Name="date_added" Type="String" />
                <asp:Parameter Name="ita_key" Type="Int64" />
                <asp:Parameter Name="Assignee3" Type="String" />
                <asp:Parameter Name="Assignee4" Type="String" />
                 <asp:Parameter Name="Assignee5" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlAssetCounter" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" SelectCommand="SELECT [ita_assetnumber] FROM [numbercounter]"></asp:SqlDataSource>
    </p>
</asp:Content>

